<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        body,
        ul {
            margin: 0;
            padding: 0;
        }

        #app {
            margin: 0 auto;
            width: 700px;
        }

        ul {
            list-style: none;
        }

        span {
            width: 150px;
            display: inline-block;
        }

        h1 {
            text-align: center;
        }
    </style>
</head>

<body>
    <div id="app">
        <h1>水果列表清单</h1>
        <ul>
            <li>
                <span>名称</span>
                <span>数量</span>
                <span>单价</span>
                <span>操作</span>
            </li>
            <!-- <li>
                <span></span>
                <span></span>
                <span></span>
                <span>
                    <button>删除</button>
                    <button>修改</button>
                </span>
            </li> -->
        </ul>
        总计：
        <p>水果名称：<input type="text"></p>
        <p>水果数量：<input type="text"></p>
        <p>水果单价：<input type="text"></p>
        <button>添加</button>
    </div>
</body>

</html>
<script>
    var fruits = [
        {
            fruitName: '苹果',
            fruitQuantity: 30,
            fruitPrice: 3.8
        },
        {
            fruitName: '西瓜',
            fruitQuantity: 240,
            fruitPrice: 1.8
        },
        {
            fruitName: '芒果',
            fruitQuantity: 60,
            fruitPrice: 7.8
        }
    ]
</script>  
<script>   
    function init() {
        let li = `<li>
            <span>${i.fruitName}</span>
            <span>${i.fruitQuantity}</span>
            <span>${i.fruitPrice}</span>
            <span></span>
            </li>`
    }
</script>